package com.crm.customers.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.customers.dao.CustomerQualificationItemDao;
import com.crm.customers.model.CustomerInfo;
import com.crm.customers.model.CustomerQualificationItem;

@Repository("customerQualificationItemDao")
public class CustomerQualificationItemDaoImpl   extends BaseDao implements CustomerQualificationItemDao {

	private static final String MAPPER_NAMESAPCE = "CustomerQualificationItemMapper.";
	
	@Override
	public int insert(CustomerQualificationItem cq) {
		return insert(MAPPER_NAMESAPCE+"insert", cq);
	}

	@Override
	public int update(CustomerQualificationItem cq) {
		return update(MAPPER_NAMESAPCE+"update", cq);
	}

	@Override
	public CustomerQualificationItem getByParams(CustomerQualificationItem cq) {
		return selectOne(MAPPER_NAMESAPCE+"getByParams",cq);
	}

	@Override
	public List<CustomerQualificationItem> getCustomerQualificationItemList(CustomerQualificationItem cq) {
		List<CustomerQualificationItem> list = selectList(MAPPER_NAMESAPCE+"getListParams",cq);
		if (list != null && list.size() > 0) {
			list.get(0).setTotalResults((Integer)selectOne(MAPPER_NAMESAPCE+"getListCountParams", cq));
		}
		return list;
	}

	@Override
	public CustomerQualificationItem getByItemid(CustomerQualificationItem cq) {
		return selectOne(MAPPER_NAMESAPCE+"getByItemid",cq);
	}

}
